﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MediatR;
using W.Purchase.API.Application.Command.SaleReturnCommand;
using W.Purchase.Domain.DTO;
namespace W.Purchase.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SaleReturnController : ControllerBase
    {
        private readonly IMediator mediator;

        public SaleReturnController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 删除批量
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> SaleReturnDelete(SaleDeleteReturnCommand command)
        {
            return await mediator.Send(command);
        }
        /// <summary>
        /// 销售反填
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<List<SalesReturnDTO>> SaleReturnFan(SaleReturnFanCommand command)
        {
            return await mediator.Send(command);
        }
    }
}
